package fr.efrei.musicpliz.entity;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;

import fr.efrei.musicpliz.enums.RoleEnum;

/**
 * Authority Entity to save the user Role
 */
@Entity
@SuppressWarnings("serial")
public class Authority extends AbstractEntity {
	private String name;
	
	@ManyToOne
	private Compte compte;
	
	public Authority() {
		// Default constructor
	}
	
	public Authority(RoleEnum role, Compte compte) {
		name = role.getRole();
		this.compte = compte;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Compte getCompte() {
		return compte;
	}

	public void setCompte(Compte compte) {
		this.compte = compte;
	}
}
